using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using SSOConfigTool.Windows.Enums;

namespace SSOConfigTool.Windows
{
    public partial class frmGetDetails : Form
    {
        public frmGetDetails()
        {
            InitializeComponent();
        }

        private string _filePath = null;

        public string FilePath
        {
            get { return this._filePath; }
        }

        public string Namespace
        {
            get { return this.txtNameSpace.Text; }
        }

        private void btnFile_Click(object sender, EventArgs e)
        {

            this.saveFileDialog1.FilterIndex = 0;
            if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string path = this.saveFileDialog1.FileName;
                this.txtFilename.Text = path;
            }
        }

        private void ucOKCancel1_OKClicked_1()
        {
            this._filePath = this.txtFilename.Text;
            this.Close();
        }

        private void ucOKCancel1_CancelClicked()
        {
            this.Close();
        }

        private GenerateMode _mode;
        public GenerateMode Mode
        {
            get{return this._mode;}
            set 
            {
                this._mode = value;
                switch (this._mode)
                {
                    case GenerateMode.Assembly:
                        this.Text = "Generated Config Assembly Details";
                        this.saveFileDialog1.Filter = "Application Extension (*.dll)|*.dll";
                        break;
                    case GenerateMode.Class:
                        this.Text = "Generated Config Class Details";
                        this.saveFileDialog1.Filter = "C# Source (*.cs)|*.cs";
                        break;
                }
            }
        }
    }
}